<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>发币</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <script src="/scripts/jquery.min.js"></script>
    <script src="/scripts/boot.js" type="text/javascript"></script>
    <script src="/scripts/miniui/miniui.js"></script>

    <style type="text/css">
        html, body {
            font-size: 12px;
            padding: 0;
            margin: 0;
            border: 0;
            height: 100%;
            overflow: hidden;
        }
    </style>
</head>
<body>
<div id="form1" style="padding-top: 20px;text-align:center;">
    <!--<span style="width:80px;display:inline-block;">objectId：</span>-->
    <!--<input id="objectId" name="objectId" class="mini-textbox" style="width:200px;" type="text" required="true"  value='<%= result.objectId %>' readonly="readonly"/>-->
    <!--<br/><br/>-->
    <!--<span style="width:80px;display:inline-block;">用户ID：</span>-->
    <!--<input id="userOId" name="userOId" class="mini-textbox" style="width:200px;" type="text" required="true"  value='<%= result.userOId %>' readonly="readonly"/>-->
    <!--<br/><br/>-->

    <!--<span style="width:80px;display:inline-block;">用户名称：</span>-->
    <!--<input id="nickName" name="nickName" class="mini-textbox" style="width:200px;" type="text" required="true" value='<%= result.nickName %>' readonly="readonly"/>-->
    <!--<br/><br/>-->

    <span style="width:80px;display:inline-block;">钱包地址：</span>
    <input id="walletAddress" name="walletAddress" class="mini-textbox" style="width:200px;" type="text" required="true" value='<%= result.walletAddress %>' readonly="readonly"/>
    <br/><br/>

    <span style="width:80px;display:inline-block;">币种：</span>
    <input id="tokenType" textName="tokenType" class="mini-combobox" style="width:200px;" data="tokenType" type="text" required="true" />
    <br/><br/>

    <!--<span style="width:80px;display:inline-block;">对方地址：</span>-->
    <!--<input id="toAddress" name="toAddress" class="mini-textbox" style="width:200px;" type="number" required="true" />-->
    <!--<br/><br/>-->

    <span style="width:80px;display:inline-block;">金额：</span>
    <input id="amount" name="amount" class="mini-textbox" style="width:200px;" type="number" required="true" />
    <br/><br/>
    <div style="margin: 0 auto;text-align: center">
        <a class="mini-button" onclick="onOk" style="width:60px;margin-right:20px;">确定</a>
        <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>
    </div>
</div>
<script type="text/javascript">

    var tokenType = JSON.parse('<%- info %>');
    mini.parse();




  var form = new mini.Form("form1");
  function SaveData() {
    var form = new mini.Form("#form1");
    form.validate();
    var data = form.getData();      //获取表单多个控件的数据
    if(form.validate() == true){
      $.ajax({
        url:"/getdata/distributeToken",
        type:'POST',
        data:data,
        success:function (result) {
          if (result){
            alert('发币成功！')
            CloseWindow("save");
          }
          else {
            alert('发币失败！')
          }
        }
      });
    } else {
      alert('请确认表单数据是否填写完整！')
    }
  };

  function CloseWindow(action) {
    if (action == "close" && form.isChanged()) {
      if (confirm("数据被修改了，是否先保存？")) {
        return false;
      }
    }
    if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
    else window.close();
  }


  function onOk(e) {
    SaveData();
  }

  function onCancel(e) {
    CloseWindow("cancel");
  }

</script>
</body>
</html>
